<?php
/*
 * Created on 23 sept. 2010
 * Created by Ludovic Reenaers
 * lreenaers@hotmail.com
 */
class ViewDocument extends View{
	function show($tab){
		$page="";
		//TODO: change for model to return only EntiteFactory->dump()
		$bean = $tab[0];
		$facto = $tab[1];
		$page.='<h2>'.$bean->getInfo($_SESSION['langue'])."</h2>";
		$type = $bean->getTypeDocument();
		$entite = $type->getEntite();
		$props = $entite->getPropriete();
		$page.='TYPE : '.$type->getLabel().'<br/>';
		$page.="Type de root Entite:".$entite->getTypeEntite()->getLabel().'<br/>';
		$page.='Nbre de propriete : '.count($props).'<br/>';
//		foreach($_POST as $key=>$val) { 
//			echo $key.'=>'.$val.'<p>'; 
//		}
		$page.="<ul>";
		foreach ($props as $Prop){
			$page.='<li>PROP:'.$Prop->getInfo($_SESSION['langue']).' OF PROP TYPE: '.$Prop->getTypePropriete()->getLabel().' WITH VALUE: '.$Prop->getValue($_SESSION['langue'])->getValueShort().'</li>';
		}
		$page .="</ul>";
		$page.="<h1>From Factory : </h1>";
		$page.=$facto->dump();
		$this->setContent($page);
	}
}
?>